<?php
class Admin_Model_DAO_I18n {
    private $_db;
    private static $_instance = null;
    private static $_table = "i18n";
    
    /**
     * @return Admin_Model_DAO_I18n
     * */
    public static function factory() {
    	if(self::$_instance == null) {
    		self::$_instance = new self();
    	}
    
    	return self::$_instance;
    }
    
    private function __construct()
    {
    	$module = Utils_Global::get('module');
    	$this->_db = Utils_Global::getDbInstance($module);
    }
    
    /**
     * Insert i18n
     * @param array $data
     * @return integer last insert id on success or 0 on failure
     * */
   public function insert($data) {
       $this->_db->insert(self::$_table, $data);
       $result = $this->_db->lastInsertId(self::$_table, 'id');
       return $result;
   }
   
   public function getDbConnection() {
       return $this->_db;
   }
}